package com.sqlsession.dm8;

import com.sqlsession.DataBase;
import com.sqlsession.mysql.MySqlDateSource;


public class DmSqlDateSource extends MySqlDateSource {

    public DmSqlDateSource(DataBase dataBase) {
        super(dataBase);
    }

    @Override
    public String getUrl() {
        DataBase dataBase = getDataBase();
        //String url = "jdbc:dm://106.14.114.161:5236/WuYiMis11?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8";
        String url = "jdbc:dm://%s:%s/%s";
        return String.format(url, dataBase.getHost(), dataBase.getPort(), dataBase.getName()) + "?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8";
    }
}
